package com.ebanca.drawme;

import java.util.ArrayList;

import android.content.Context;
import android.widget.ArrayAdapter;

/**
 * Custom list adapter used to provide a common way of holding 
 * the view items. 
 */
public class CustomListAdapter extends ArrayAdapter {

	protected ArrayList items;
	
	// used to keep selected position in ListView
	protected int selectedPos = -1;	// init value for not-selected
	protected boolean disabledButtons = false;

	public CustomListAdapter(Context context, int textViewResourceId, ArrayList items) {
		super(context, textViewResourceId, items);
		this.items = items;
	}
	
	public void setSelectedPosition(int pos){
		selectedPos = pos;
		// inform the view of this change
		notifyDataSetChanged();
	}

	public int getSelectedPosition(){
		return selectedPos;
	}
}
